using System;
using System.Data;
using System.Data.SqlClient;
 

/// <summary>
/// Summary description for Recruiter
/// </summary>
public partial class SqlServerProvider
{


    public void IncreaseJobView(string jobID)
    {
        errorMessage = "";
        try
        {
            OpenConnection();
            sqlCommand = new SqlCommand();
            sqlCommand.CommandText = 
            "Update tblRCJobPostings set " +
            "ViewedNo = ViewedNo+1 where JobID=@JobID";
            sqlCommand.Connection = sqlConnection;
            sqlCommand.CommandType =
            CommandType.Text;
            sqlCommand.Parameters.AddWithValue(
            "@JobID", jobID);            
            sqlCommand.ExecuteNonQuery() ;
            CloseConnection();
        }
        catch (SqlException sql)
        {
            errorCode = sql.Number;
            errorMessage = sql.Message;
        }
        catch (Exception ex)
        {
            errorMessage = ex.Message;

        }
    }
}